package org.ourguy.mymoviesandshows.apiclient;

import java.util.ArrayList;
import java.util.Hashtable;

import org.ourguy.mymoviesandshows.datamodel.ITitle;

/**
 * Interface for generic API drivers.
 * @author ignisf
 */
public interface ITitleAPIClient {
	/**
	 * Provides a method to search for a movie or show by its title.
	 * @param query The title we are looking for
	 * @return The list of titles matching the query
	 * @throws APIException Throws an exception if something goes wrong.
	 */
	public ArrayList<ITitle> searchTitles(String query) throws APIException;
	
	/**
	 * Get summary information for a title by its ID
	 * @param id The ID of the title.
	 * @return The summary information for the title.
	 * @throws APIException Throws an exception if something goes wrong.
	 */
	public ITitle getTitleSummary(String id) throws APIException;
	
	/**
	 * Get an ordered list of trending titles.
	 * @return The list of trending titles.
	 * @throws APIException Throws an exception if something goes wrong.
	 */
	public ArrayList<ITitle> getTrendingTitles() throws APIException;
	
	/**
	 * Get a slim hashtable of the apiId -> title format for a given query 
	 * @param q the string we are looking for in the title
	 * @return the results
	 * @throws APIException
	 */
	public Hashtable<String, String> autoCompleteTitle(String q) 
			throws APIException;
}
